package or.exa.cangguan.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import or.exa.cangguan.entity.vo.UserVo;
import or.exa.cangguan.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "用户注册")
@RestController
@Slf4j
public class RegisterController {

    @Autowired
    private RegisterService registerService;



    @ApiOperation(value = "注册")
    @PostMapping("/login/register")
    public Integer register(@RequestBody UserVo userVo) {
        log.info("注册用户名: {}", userVo.getUsername());
        log.info("注册密码: {}", userVo.getPassword());
        Integer i = registerService.register(userVo.getUsername(), userVo.getPassword());
        return i;
    }




}
